package com.zhuzhe.blog.advice;


import com.zhuzhe.blog.enums.ResponseEnum;

/**
 * @description  抓取runtimeException
 * @author: u53
 * @create: 2020-10-21 14:50
 **/
public class BusinessException extends RuntimeException {
    private Integer code;

    public BusinessException() {
    }
    // 给子类用的方法
    public BusinessException(ResponseEnum ResponseEnum) {
        this(ResponseEnum.getCode(), ResponseEnum.getMsg());
    }

    private BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
